package com.weixing.mall.provider.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.weixing.mall.provider.api.model.dto.UserDto;
import com.weixing.mall.provider.api.model.vo.*;
import com.weixing.mall.provider.model.domain.User;
import com.weixing.mall.provider.model.dto.sys.ResetPasswordDto;
import com.weixing.mall.provider.model.dto.sys.SysUserDto;
import com.weixing.mall.provider.model.enums.sys.SysFlag;
import com.weixing.mall.provider.model.query.SysUserQuery;
import com.weixing.mall.provider.model.vo.FrontUserVo;
import com.weixing.mall.provider.model.vo.sys.SysUserRoleVo;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 系统模块-后台用户表 服务类
 * </p>
 *
 * @author Small
 * @since 2019-11-18
 */
public interface IUserService extends IService<User> {

    IPage<SysUserVo> selectOfPage(Page initMpPage, SysUserQuery sysUserQuery);

    User findByLoginName(String loginName);

    User findByMobile(String s);

    void save(SysUserDto sysUserDto);

    void resetPwd(User user);

    void changeEnable(Long userId, Integer value);

    SysUserEditVo selectSysUserEditVoById(long id);

    List<SysUserRoleVo> selectSysUserByRoleCode(String roleCode,Integer isEnable);

    Set<String> loadUserAuthorities(Long userId);

    List<VueAuthorizeBean> loadVueAuthorize(Long userId, SysFlag sysFlag);

    void changeAvatar(String avatar, Long uid);

    void changePassword(ResetPasswordDto dto, User sysUser);

    List<RoleVo> getRoleById(Long id);


    FrontUserVo querySysUser(Long id);

    FrontUserVo queryMemberUser(Long id);

    List<KefuVo> loadKefu();

    KefuVo loadKefuById(Long id);

    Long createUser(UserDto userDto);

    IPage<KefuVo> loadKefuOfPage(Page initMpPage);

    KefuVo loadKefuByLoginName(String loginName);

    void updateCid(String mobile, Long mid);

    List<SysUserRoleVo> selectSysUserByRoleCode(List<String> roleCode,Integer isEnable);

    List<VueAuthorizeBean> loadVueAuthorizeByRoleCode(String roleCode, SysFlag agent);
}
